<template>
  <div class="goods-list">
   <goods-list-item class="item" v-for="item in goods" :goodsitem="item"/>
  </div>
</template>

<script>
import GoodsListItem from "./GoodsListItem";

export default {
  name: "GoodsList",
  components: {
    GoodsListItem
  },
  props: {
    goods: {
      type: Array,
      default() {
        return []
      }
    }
  }
}
</script>

<style scoped>
.goods-list {
  display: flex;
  flex-wrap: wrap;          /*元素在必要的时候拆行*/
  padding: 8px;
  justify-content: space-around;     /*项目位于各行之前、之间、之后都留有空白的容器内。*/
}

.goods-list .item {
  width: 48%;
}
</style>